{% extends "menu.html" %}
{% block content %}

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">



            </div>
            <div class="clearfix"></div>
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>查询</h2>

                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br />
                    <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 选择项目<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select style="margin-top: 5px;width: 60%;height: 30px" name="project_name">
                              {% for log in project_list %}
                              <option value="{{ log.project_name }}">{{ log.project_name }}</option>
                              {% endfor %}
                          </select>
                        </div>
                      </div>


                        <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <span>{{ result }}</span>
                        </div>
                      </div>
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button class="btn btn-primary" type="button">Cancel</button>
						  <button class="btn btn-primary" type="reset">Reset</button>
                          <button type="submit" class="btn btn-success">Submit</button>
                        </div>
                      </div>

                    </form>
                  </div>
                </div>
                  <div class="x_panel">
                  <div class="x_title">
                    <h2>查询结果</h2>

                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br />
                    <table class="sui-table table-bordered">
                          <thead>
                            <tr>
                                <th>所属项目</th>
                                <th>区服</th>
                                <th>上次记录值 </th>
                                <th>当前记录值 </th>
                                <th>所属服务器</th>
                                <th>IP</th>
                                <th>状态</th>
                                <th>更新时间</th>


                            </tr>
                          </thead>
                          <tbody>
                          <style type="text/css">
                             tr:hover{
                                 background-color: #FFFFE0;
                             }
                          </style>
                          {% for i in log_list %}
                            <tr>

                                <td>{{ i.project_name}}</td>
                                <td>{{ i.zone_log }}</td>
                                <td>{{ i.last_count }}</td>
                                <td>{{ i.now_count }}</td>
                                <td>{{ i.server_name }}</td>
                                <td><a href="/monitor/logshow/?ip={{ i.ip }}&log_path={{ i.log_path }}&zone_log={{ i.zone_log }}">{{ i.ip }}</a></td>
                                <td bgcolor="{{ i.status  }}"></td>
                                <td>{{ i.up_time }}</td>

                            </tr>
                        {% endfor %}
                          </tbody>
                      </table>
                  </div>
                </div>
              </div>
            </div>


          </div>
        </div>
{% endblock %}